package com.designPattern.singleton;

/**
 * 在jdk源码中，Runtime创建对象的时候也用到了【饿汉式】【静态代码块】【单例模式】创建Runtime对象
 * @author mxs
 */
public class ExampleInJdk {
    public static void main(String[] args) {
        //Runtime
        //Runtime部分源码分析
//        public class Runtime {
            //在创建类的时候就创建对象
//            private static Runtime currentRuntime = new Runtime();
//
//            /**
//             * Returns the runtime object associated with the current Java application.
//             * Most of the methods of class <code>Runtime</code> are instance
//             * methods and must be invoked with respect to the current runtime object.
//             *
//             * @return  the <code>Runtime</code> object associated with the current
//             *          Java application.
//             */
                //向外提供一个静态方法返回Runtime对象
//            public static Runtime getRuntime() {
//                return currentRuntime;
//            }
//
//            /** Don't let anyone else instantiate this class */
             /**防止其他人可以实例化这个对象 */
//            private Runtime() {}
//            }


    }
}
